home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Utilities Experience
/
The Utilities Experience - Volume 1.iso
/
software
/
workbench+shell
/
a-f
/
executive_v1.20
/
register.lzx
/
Register.rexx
< prev
Wrap
OS/2 REXX Batch file
|
2001-04-24
|
9KB
|
256 lines
/*
* Fill in a registration form for Executive.
*
* Copyright © 1995 Petri Nordlund. All rights reserved.
*
* $Id: Register.rexx 1.2 1995/10/05 12:26:08 petrin Exp petrin $
*
*/
regform = 'RAM:regform'
csi='9b'x;f.slant=csi'3m'; f.bold=csi'1m'; f.norm=csi'0m'
f.black=csi'31m'; f.white=csi'32m'; f.blue=csi'33m'
f.lf = '0a'x; f.cls = csi'0;0H'csi'J'
options prompt f.white'> 'f.black
payment1 = "Cash (please don't send coins)"
payment2 = 'Eurocheque for 70 FIM'
payment2a = '- you must write your card number on the back of the cheque'
payment3 = 'Money transfer of 70 FIM to this account:'
payment3a = '- bank: Postipankki Ltd, Helsinki, Finland'
payment3b = '- account number 8000 29-26522193'
payment3c = '- pay via Eurogiro or SWIFT'
payment3d = '- SWIFT address: PSPBFIHH; Telex 121 698 pgiro fi'
payment3e = '- include a copy of the receipt with this form'
payment4 = 'Postiennakko (Finland only)'
payment4a = '- postiennakkomaksu 25 mk lisätään hintaan (70+25=95 mk)'
cash1 = '$15 (US dollar)'
cash2 = '£10 (Pound sterling)'
cash3 = '70 FIM (Finnish mark)'
cash4 = '25 DEM (Deutsche mark)'
cash5 = '100 NOK (Norwegian krone)'
cash6 = '120 SEK (Swedish krona)'
cash7 = '500 BEF (Belgian franc)'
cash8 = '70 FRF (French franc)'
cash9 = '25 NLG (Dutch guilder)'
cash10 = '100 DKK (Danish krone)'
delivery1 = 'by airmail on a 3.5" disk'
delivery2 = 'keyfile emailed to you'
say f.white
say 'Welcome to Executive registration form generator.'
say 'Now please answer all the questions. The registration form is written'
say 'to file 'f.bold''regform''f.norm''f.white'. You can abort by pressing CTRL-C. When'
say 'several lines are available for your answer, just hit ENTER on the'
say 'lines you don''t need.'
say f.black
/* User */
say 'What is your name?'
parse pull i_Name
say
say 'What is your full snailmail address (including country)? [5 lines available]'
i_Addr1 = GetLine(1)
i_Addr2 = GetLine(2)
i_Addr3 = GetLine(3)
i_Addr4 = GetLine(4)
i_Addr5 = GetLine(5)
say
say 'What is your phone number?'
parse pull i_Phone
say
say 'What is your Internet email address?'
parse pull i_Email
say
say 'Payment by: 1. 'payment1
say ' 2. 'payment2
say ' 'payment2a
say ' 3. 'payment3
say ' 'payment3a
say ' 'payment3b
say ' 'payment3c
say ' 'payment3d
say ' 'payment3e
say ' 4. 'payment4
say ' 'payment4a
parse pull i_PaymentBy
say
if i_PaymentBy = 1 then do
say 'Currency: 1. 'cash1
say ' 2. 'cash2
say ' 3. 'cash3
say ' 4. 'cash4
say ' 5. 'cash5
say ' 6. 'cash6
say ' 7. 'cash7
say ' 8. 'cash8
say ' 9. 'cash9
say ' 10. 'cash10
parse pull i_Currency
say
end
say 'Delivery: 1. 'delivery1
say ' 2. 'delivery2
parse pull i_Delivery
say
/* Write registration form */
outf = 'rffile'
if open(outf,regform,'W') then do
call writeln(outf,'## ## ##### #### ##')
call writeln(outf,' ## ## ## ## ##')
call writeln(outf,' #### #### ### ##')
call writeln(outf,' ## ## ##')
call writeln(outf,' ## ##### #### ## Please send me a keyfile for Executive!')
call writeln(outf,'___________________________________________________________________________' f.lf f.lf)
call writeln(outf,'Name: 'i_Name f.lf)
call writeln(outf,'Address: 'i_Addr1)
call writeln(outf,' 'i_Addr2)
call writeln(outf,' 'i_Addr3)
call writeln(outf,' 'i_Addr4)
call writeln(outf,' 'i_Addr5 f.lf)
call writeln(outf,'Phone: 'i_Phone f.lf)
call writeln(outf,'Email: 'i_Email f.lf)
call writeln(outf,'')
if i_PaymentBy = 1 then do
call writeln(outf,'Payment by: [X] 'payment1)
if i_Currency = 1 then call writeln(outf,' - 'cash1)
if i_Currency = 2 then call writeln(outf,' - 'cash2)
if i_Currency = 3 then call writeln(outf,' - 'cash3)
if i_Currency = 4 then call writeln(outf,' - 'cash4)
if i_Currency = 5 then call writeln(outf,' - 'cash5)
if i_Currency = 6 then call writeln(outf,' - 'cash6)
if i_Currency = 7 then call writeln(outf,' - 'cash7)
if i_Currency = 8 then call writeln(outf,' - 'cash8)
if i_Currency = 9 then call writeln(outf,' - 'cash9)
if i_Currency = 10 then call writeln(outf,' - 'cash10)
call writeln(outf,' [ ] 'payment2)
call writeln(outf,' 'payment2a)
call writeln(outf,' [ ] 'payment3)
call writeln(outf,' 'payment3a)
call writeln(outf,' 'payment3b)
call writeln(outf,' 'payment3c)
call writeln(outf,' 'payment3d)
call writeln(outf,' 'payment3e)
call writeln(outf,' [ ] 'payment4)
call writeln(outf,' 'payment4a)
end
if i_PaymentBy = 2 then do
call writeln(outf,'Payment by: [ ] 'payment1)
call writeln(outf,' [X] 'payment2)
call writeln(outf,' 'payment2a)
call writeln(outf,' [ ] 'payment3)
call writeln(outf,' 'payment3a)
call writeln(outf,' 'payment3b)
call writeln(outf,' 'payment3c)
call writeln(outf,' 'payment3d)
call writeln(outf,' 'payment3e)
call writeln(outf,' [ ] 'payment4)
call writeln(outf,' 'payment4a)
end
if i_PaymentBy = 3 then do
call writeln(outf,'Payment by: [ ] 'payment1)
call writeln(outf,' [ ] 'payment2)
call writeln(outf,' 'payment2a)
call writeln(outf,' [X] 'payment3)
call writeln(outf,' 'payment3a)
call writeln(outf,' 'payment3b)
call writeln(outf,' 'payment3c)
call writeln(outf,' 'payment3d)
call writeln(outf,' 'payment3e)
call writeln(outf,' [ ] 'payment4)
call writeln(outf,' 'payment4a)
if i_PaymentBy = 4 then do
call writeln(outf,'Payment by: [ ] 'payment1)
call writeln(outf,' [ ] 'payment2)
call writeln(outf,' 'payment2a)
call writeln(outf,' [ ] 'payment3)
call writeln(outf,' 'payment3a)
call writeln(outf,' 'payment3b)
call writeln(outf,' 'payment3c)
call writeln(outf,' 'payment3d)
call writeln(outf,' 'payment3e)
call writeln(outf,' [X] 'payment4)
call writeln(outf,' 'payment4a)
end
call writeln(outf,f.lf)
if i_Delivery = 1 then do
call writeln(outf,'Delivery: [X] 'delivery1)
call writeln(outf,' [ ] 'delivery2)
end
else do
call writeln(outf,'Delivery: [ ] 'delivery1)
call writeln(outf,' [X] 'delivery2)
end
call writeln(outf,f.lf f.lf)
call writeln(outf,'Registration date:' date() f.lf f.lf f.lf f.lf)
call writeln(outf,'______________________________________')
call writeln(outf,'signature' f.lf f.lf)
call writeln(outf,'Thank you for registering Executive!' f.lf f.lf)
call writeln(outf,'___________________________________________________________________________')
call writeln(outf,'Petri Nordlund email: petrin@megabaud.fi')
call writeln(outf,'Vanhamaantie 4 petrin@sik.ppoy.fi')
call writeln(outf,'28800 PORI')
call writeln(outf,'FINLAND WWW: http://www.megabaud.fi/~petrin/Executive.html')
say 'The registration form has been written to file 'f.bold''regform''f.norm'.'
say 'This file is a normal ASCII file, so you can edit it with a text'
say 'editor if necessary.'
say f.white f.slant
say 'Thank you for registering Executive!' f.norm f.black f.lf
end
else
signal error_file
address command 'delete RAM:_regform.tmp >NIL:'
exit 0
/* MAIN PROGRAM ENDS HERE, PROCEDURES FOLLOW */
/* Failed when trying to write the registration form file */
error_file:
say f.white f.bold
say 'Can''t write file "'regform'".'
say f.norm f.black
exit 20
/* GetRes */
GetRes:
if open(6Res, 'RAM:_regform.tmp', 'R') then do
Res = readln(6Res)
call close 6Res
end
else
Res = ''
return Res
/* GetLine */
GetLine:
options prompt f.white''arg(1)'> 'f.black
parse pull str
options prompt f.white'> 'f.black
return str